//
//  HRUserGoodsTableSectionFoot.m
//  haierapp
//
//  Created by Xia Zhiyong on 14-8-12.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import "HRUserGoodsTableSectionFoot.h"
#import "ActionSheet.h"
#import "HRCancelOrderView.h"

@implementation HRUserGoodsTableSectionFoot

-(id)initWithType:(NSInteger)type{
    self = [[[NSBundle mainBundle] loadNibNamed:@"HRUserGoodsTableSectionFoot"
                                          owner:self
                                        options:nil] objectAtIndex:0];
    switch (type) {
        case ORDER_TYPE_WAIT_FOR_PAY:
            _viewWaitPay.hidden = NO;
            break;
        case ORDER_TYPE_WAIT_FOR_DELIVERY:
            _viewDeliver.hidden = NO;
            break;
        case ORDER_TYPE_WAIT_FOR_RECEIPT:
            _viewWaitTake.hidden = NO;
            break;
        case ORDER_TYPE_REFUNDING:
            break;
        case ORDER_TYPE_SUCCEED:
            _viewBuySucceed.hidden = NO;
            break;
        case ORDER_TYPE_CLOSED:
            _viewClosed.hidden = NO;
            break;
        case ORDER_TYPE_AFTERSALE_DEALING:
            _viewAfter.hidden = NO;
            break;
        case ORDER_TYPE_WAIT_COMMENT:
            _viewWaitComment.hidden = NO;
            break;
        default:
            break;
    }
    [_lblDetail setTextAlignment:RTTextAlignmentRight];
    return self;

}

- (IBAction)actionProgress:(id)sender {
}

- (IBAction)actionComment:(id)sender {
}

- (IBAction)actionBuyAgain:(id)sender {
}

- (IBAction)actionTakeGoods:(id)sender {
}

- (IBAction)actionCancel:(id)sender {
    HRCancelOrderView *view = [[HRCancelOrderView alloc] init];
    [view loadTable];
    
    ActionSheet* actionSheet =  [[ActionSheet alloc] initWithTitle:@"请选择取消订单的理由" delegate:self cancelButtonTitle:@"确定" viewCustom:view otherButtonTitles:nil];
    [actionSheet show];
}

- (IBAction)actionPay:(id)sender {
}

- (IBAction)actionAfterProgress:(id)sender {
}

- (void)actionSheet:(ActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
    NSLog(@">>>>>%d",buttonIndex);
   
}
@end
